﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace homework2
{
    internal class Program
    {
        static void Main(string[] args)
        {
           
                Console.WriteLine("{0,-10} {1,10} {2,30} {3,30}", "Type", "Size (bytes)", "Min Value", "Max Value");
                Console.WriteLine(new string('-', 85));
                PrintTypeInfo<sbyte>("sbyte");
                PrintTypeInfo<byte>("byte");
                PrintTypeInfo<short>("short");
                PrintTypeInfo<ushort>("ushort");
                PrintTypeInfo<int>("int");
                PrintTypeInfo<uint>("uint");
                PrintTypeInfo<long>("long");
                PrintTypeInfo<ulong>("ulong");
                PrintTypeInfo<float>("float");
                PrintTypeInfo<double>("double");
                PrintTypeInfo<decimal>("decimal");
            }
            static void PrintTypeInfo<T>(string typeName) where T : struct
            {
               
                int size = System.Runtime.InteropServices.Marshal.SizeOf(typeof(T));
                dynamic minValue = typeof(T).GetField("MinValue").GetValue(null);
                dynamic maxValue = typeof(T).GetField("MaxValue").GetValue(null);
                Console.WriteLine("{0,-10} {1,10} {2,30} {3,30}", typeName, size, minValue, maxValue);
            }
        }
}
